<template>
  <div>
    <div class="img-wrap">
      <img
        src="https://akk.028wkf.cn/kdb-weapp-img/index.jpg"
        mode="widthFix"
        class="bg"
      />
      <div class="mask">
        <!-- <a
          href="/pages/open-shop/store-register/step1/main"
          class="open-shop"
        >我要开店</a>-->
        <a
          href="/pages/open-shop/store-login/main"
          class="gradient-btn-blue1"
        >我要开店</a>
        <a href="/pages/login/login/main" class="gradient-btn-blue">登 录</a>
      </div>
    </div>
  </div>
</template>

<script>
import { getToken } from '@/utils'

export default {
  components: {},
  props: {},
  data () {
    return {}
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  onShow () {
    // this.$cookie.remove('my-cookie')
    this.autoLogin()
  },
  onShareAppMessage () {
    return {
      title: '开店宝',
      path: '/pages/login/index/main',
      // imageUrl: this.qrURL,
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },
  methods: {
    autoLogin () {
      this.$cookie.remove('store-mobile')
      if (getToken()) {
        this.$store.commit('SET_ACCOUNT_INFO', this.$cookie.get('account'))
        this.$router.switch('/pages/home/index/main')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
@import 'static/styles/color.scss';

.img-wrap {
  width: 100%;
  position: relative;
  > .bg {
    width: 100%;
  }
  > .mask {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    // > .open-shop {
    //   position: absolute;
    //   color: $white;
    //   top: 0;
    //   right: 0;
    //   padding: 5px 10px;
    //   font-size: 15px;
    // }

    > .gradient-btn-blue {
      position: absolute;
      bottom: 50px;
      left: 30%;
      transform: translateX(-50%);
    }
    > .gradient-btn-blue1 {
      position: absolute;
      bottom: 50px;
      right: 0;
      transform: translateX(-50%);
    }
  }
}
</style>
